package com.imooc.reader.management.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.imooc.reader.management.entity.Menu;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MenuMapper extends BaseMapper {

    @Select("select m.* from role_user rs, role_menu rm, menu m\n" +
            "where rs.role_id = rm.role_id and rm.menu_id = m.menu_id\n" +
            "  and rs.user_id = #{value} order by seq")
    List<Menu> selectByUserId(Integer userId);
}
